package com.bat.util;

import cn.hutool.core.lang.UUID;

/**
 * @program: util
 * @description:
 * @author: zhoupengfei
 * @create: 2019-10-12 10:34
 **/
public class TraceUtil {
    public static String traceid="traceid";
    public static ThreadLocal<String> traceIdTreadLocal = new ThreadLocal<>();

    public static String getTraceId() {
        if (traceIdTreadLocal.get() == null) {
            traceIdTreadLocal.set(UUID.fastUUID().toString());
        }
        return traceIdTreadLocal.get();
    }
}